import { Component } from '@angular/core';
import { ApesField } from '@shared/ui-zorro/src/types/apes-field';
import { ExpressionService } from '@core/services/expression/ExpressionService';
import { Events } from '@core/services/events/Events';
import { SubjectService } from '@core/services/events/subject.service';
import { ApiService } from '@core/services/http/api.service';
import { getO, missingOrEmpty } from '../../../../utils/utils';

@Component({
  selector: 'formly-field-placeholder',
  template: `
    <div apes-col [apesMd]="getDivCol()">
      <apes-form-item [ngStyle]="style">
        <!--<p style="height:42px;"></p>-->
      </apes-form-item>
    </div>
  `
})
/* 界面占位符 */
export class FormlyFieldPlaceholder extends ApesField {

  style = {'margin-bottom':0, 'max-height': '42px', 'min-height': '42px'};

  constructor(protected apiService: ApiService, protected events: Events, protected expressionService: ExpressionService, protected subject: SubjectService) {
    super(apiService, events, expressionService, subject);
  }

  ngAfterViewInit() {
    if(this.to['style']){
      this.style = getO(this.to['style'])
    }
  }

  getDivCol() {
    return this.to.divCol || 8;
  }

}

